home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Window;
-
- public class BasicToolBarUI$DragWindow extends Window {
- // $FF: synthetic field
- private final BasicToolBarUI this$0;
- Color borderColor;
- int orientation;
- Point offset;
-
- BasicToolBarUI$DragWindow(BasicToolBarUI var1, Frame var2) {
- super(var2);
- this.this$0 = var1;
- this.borderColor = Color.gray;
- this.orientation = this.this$0.toolBar.getOrientation();
- }
-
- public Color getBorderColor() {
- return this.borderColor;
- }
-
- public Insets getInsets() {
- return new Insets(1, 1, 1, 1);
- }
-
- public Point getOffset() {
- return this.offset;
- }
-
- public void paint(Graphics var1) {
- Color var2 = var1.getColor();
- var1.setColor(((Component)this).getBackground());
- Dimension var3 = ((Component)this).getSize();
- var1.fillRect(0, 0, var3.width, var3.height);
- var1.setColor(this.getBorderColor());
- var1.drawRect(0, 0, var3.width - 1, var3.height - 1);
- var1.setColor(var2);
- super.paint(var1);
- }
-
- public void setBorderColor(Color var1) {
- if (this.borderColor != var1) {
- this.borderColor = var1;
- ((Component)this).repaint();
- }
- }
-
- public void setOffset(Point var1) {
- this.offset = var1;
- }
-
- public void setOrientation(int var1) {
- if (((Window)this).isShowing()) {
- if (var1 == this.orientation) {
- return;
- }
-
- this.orientation = var1;
- Dimension var2 = ((Component)this).getSize();
- ((Component)this).setSize(new Dimension(var2.height, var2.width));
- if (this.offset != null) {
- if (BasicGraphicsUtils.isLeftToRight(this.this$0.toolBar)) {
- this.setOffset(new Point(this.offset.y, this.offset.x));
- } else if (var1 == 0) {
- this.setOffset(new Point(var2.height - this.offset.y, this.offset.x));
- } else {
- this.setOffset(new Point(this.offset.y, var2.width - this.offset.x));
- }
- }
-
- ((Component)this).repaint();
- }
-
- }
- }
-